import React from 'react';
import { Outlet, useLocation } from 'react-router-dom';
import { UserProfileCard, FeatureList, SettingsList } from '../../components/Mypage';

const Profile: React.FC = () => {
  const location = useLocation();
  const isSubRoute = location.pathname !== '/index/profile';

  return (
    <div className="profile-container">
      {isSubRoute ? (
        <Outlet />
      ) : (
        <>
          <UserProfileCard />
          <FeatureList />
          <SettingsList />
        </>
      )}
    </div>
  );
};

export default Profile;

